﻿using System;
using System.Drawing.Drawing2D;
using Autodesk.Revit.DB;
using SystemDiagramNew.TypeDefinition;

namespace SystemDiagramNew.SystemDiagramLegend
{
	public struct CurveInfo
	{
		public CurveInfo(CurveInfo rhs)
		{
			this.m_Curve = rhs.CurveObj;
			this.m_Color = rhs.Color;
			this.m_DashStyle = rhs.m_DashStyle;
			this.m_LineWidth = rhs.m_LineWidth;
		}

		public CurveInfo(EdgeInfo curve, PenColor color, float lineWidth)
		{
			this.m_Curve = curve;
			this.m_Color = color;
			this.m_DashStyle = DashStyle.Solid;
			this.m_LineWidth = lineWidth;
		}

		public CurveInfo(EdgeInfo curve, PenColor color, DashStyle dashStyle, float lineWidth)
		{
			this.m_Curve = curve;
			this.m_Color = color;
			this.m_DashStyle = dashStyle;
			this.m_LineWidth = lineWidth;
		}

		public EdgeInfo CurveObj
		{
			get
			{
				return this.m_Curve;
			}
		}

		public PenColor Color
		{
			get
			{
				return this.m_Color;
			}
		}

		public DashStyle PenDashStyle
		{
			get
			{
				return this.m_DashStyle;
			}
			set
			{
				this.m_DashStyle = value;
			}
		}

		public float LineWidth
		{
			get
			{
				return this.m_LineWidth;
			}
		}

		public bool IsNull()
		{
			return this.m_Curve == null;
		}

		public void ScalingTransformation(Transform transform)
		{
			XYZ startPoint = Geometry.TransformPoint(this.m_Curve.StartPoint, transform);
			XYZ endPoint = Geometry.TransformPoint(this.m_Curve.EndPoint, transform);
			this.m_Curve.StartPoint = startPoint;
			this.m_Curve.EndPoint = endPoint;
		}

		private readonly PenColor m_Color;

		private readonly EdgeInfo m_Curve;

		private readonly float m_LineWidth;

		private DashStyle m_DashStyle;
	}
}
